﻿using System;

namespace Jet.Dal
{
	/// <summary>
	/// Determine unit of work which responsible for commiting changes to database
	/// </summary>
	public interface IUnitOfWork : IDisposable
	{
		/// <summary>
		/// Returns the repository
		/// </summary>
		IRepository<TKey, TEntity> GetRepository<TKey, TEntity>() where TEntity : class where TKey : class;

		/// <summary>
		/// Save all changes in related repositories to database
		/// </summary>
		void SaveChanges();
	}
}
